﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Editor
{
    using GdiColor = System.Drawing.Color;
    using XnaColor = Microsoft.Xna.Framework.Graphics.Color;

    public partial class SystemControl : Form
    {
        public SystemControl()
        {
            InitializeComponent();
        }

        private void panel1_MouseClick(object sender, MouseEventArgs e)
        {
            StartColorDialog.ShowDialog();
            StartColorPanel.BackColor = StartColorDialog.Color;
            StartColorRed.Value = StartColorDialog.Color.R;
            StartColorGreen.Value = StartColorDialog.Color.G;
            StartColorBlue.Value = StartColorDialog.Color.B;
        }

        private void EndColorPanel_MouseClick(object sender, MouseEventArgs e)
        {
            EndColorDialog.ShowDialog();
            EndColorPanel.BackColor = EndColorDialog.Color;
            EndColorRed.Value = EndColorDialog.Color.R;
            EndColorGreen.Value = EndColorDialog.Color.G;
            EndColorBlue.Value = EndColorDialog.Color.B;
        }

        private void SystemControl_Load(object sender, EventArgs e)
        {
            
        }

        private void StartColorRed_ValueChanged(object sender, EventArgs e)
        {
            StartColorPanel.BackColor = Color.FromArgb(255, (int)StartColorRed.Value, (int)StartColorGreen.Value, (int)StartColorBlue.Value);
        }

        private void StartColorGreen_ValueChanged(object sender, EventArgs e)
        {
            StartColorPanel.BackColor = Color.FromArgb(255, (int)StartColorRed.Value, (int)StartColorGreen.Value, (int)StartColorBlue.Value);
        }

        private void StartColorBlue_ValueChanged(object sender, EventArgs e)
        {
            StartColorPanel.BackColor = Color.FromArgb(255, (int)StartColorRed.Value, (int)StartColorGreen.Value, (int)StartColorBlue.Value);
        }

        private void EndColorRed_ValueChanged(object sender, EventArgs e)
        {
            EndColorPanel.BackColor = Color.FromArgb(255, (int)EndColorRed.Value, (int)EndColorGreen.Value, (int)EndColorBlue.Value);
        }

        private void EndColorGreen_ValueChanged(object sender, EventArgs e)
        {
            EndColorPanel.BackColor = Color.FromArgb(255, (int)EndColorRed.Value, (int)EndColorGreen.Value, (int)EndColorBlue.Value);
        }

        private void EndColorBlue_ValueChanged(object sender, EventArgs e)
        {
            EndColorPanel.BackColor = Color.FromArgb(255, (int)EndColorRed.Value, (int)EndColorGreen.Value, (int)EndColorBlue.Value);
        }

        private void SystemControl_FormClosed(object sender, FormClosedEventArgs e)
        {
        
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (DialogResult.OK == OFD.ShowDialog())
            {
                TBCurrentTexture.Text = OFD.FileName;
            }
        }

        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            RenderWindowColorDialog.ShowDialog();
            DisplayWindow.BackgroundColor.A = 255;
            DisplayWindow.BackgroundColor.R = RenderWindowColorDialog.Color.R;
            DisplayWindow.BackgroundColor.G = RenderWindowColorDialog.Color.G;
            DisplayWindow.BackgroundColor.B = RenderWindowColorDialog.Color.B;
            
        }
    }
}
